package AcWing周赛;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: a
 * Date: 2022-08-27
 * Time: 19:02
 */
public class Demo66_1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.next();
        int len = str.length();
        int x = str.charAt(len - 1) - '0';
        if(x % 2 == 0){
            System.out.println("0");
        }else{
            System.out.println("1");
        }
    }
}
